package com.wh.hotel.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author wenhao
 */
@AllArgsConstructor
@Getter
public enum PayWayEnum {
    CASH(0, "现付"),
    ADVANCE(1, "预付"),
    ;

    private final int code;
    private final String desc;

    public static PayWayEnum parse(Integer code) {
        if (code == null) {
            return null;
        }
        for (PayWayEnum payWayEnum : PayWayEnum.values()) {
            if (payWayEnum.getCode() == code) {
                return payWayEnum;
            }
        }
        return null;
    }
}
